package com.example.peibei.ui.adapter;

import android.graphics.Color;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.dingtao.common.bean.PaidanList2;
import com.dingtao.common.bean.PaidanList3;
import com.example.peibei.R;
import com.scwang.smartrefresh.layout.util.DensityUtil;
import com.tencent.qcloud.tuikit.tuicontact.component.CircleImageView;

import java.util.List;

public class PaidanLists2Adapter extends BaseQuickAdapter<PaidanList3, BaseViewHolder> {
    public PaidanLists2Adapter() {
        super(R.layout.item_paidan_list2);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, PaidanList3 paidanList2) {
        baseViewHolder.setText(R.id.tv_date,paidanList2.getDate());
        baseViewHolder.setText(R.id.tv_content,paidanList2.getContent());
        baseViewHolder.setText(R.id.tv_price,paidanList2.getPrice());
        baseViewHolder.setText(R.id.tv_category,paidanList2.getCategory());
        baseViewHolder.setText(R.id.tv_city_name,"来自于"+paidanList2.getArea());
        baseViewHolder.setText(R.id.tv_nickname,paidanList2.getNickname());
        ImageView iv_avatar = baseViewHolder.getView(R.id.iv_avatar);
        Glide.with(getContext()).load(paidanList2.getMemberImg()).into(iv_avatar);
        baseViewHolder.setGone(R.id.cancel_ll,paidanList2.getStatus() != 0);
        if (paidanList2.getStatus() == 0){
            baseViewHolder.setText(R.id.status_tv,"申请中");
        }else if (paidanList2.getStatus() == 1){
            baseViewHolder.setText(R.id.status_tv,"进行中");
        }else if (paidanList2.getStatus() == 2){
            baseViewHolder.setText(R.id.status_tv,"已完成");
        }

    }
}
